
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using FreeSql.DataAnnotations;

namespace RsCms.Entities {

	[JsonObject(MemberSerialization.OptIn), Table(Name = "comments")]
	public partial class Comments {

		[JsonProperty, Column(Name = "id", DbType = "varchar(24)", IsPrimary = true)]
		public long Id { get; set; }

		[JsonProperty, Column(Name = "member_id", DbType = "varchar(24)")]
		public string MemberId { get => _MemberId; set {
			if (_MemberId == value) return;
			_MemberId = value;
			members = null;
		} }
		private string _MemberId;

		[JsonProperty, Column(Name = "parent_id", DbType = "varchar(24)")]
		public string ParentId { get => _ParentId; set {
			if (_ParentId == value) return;
			_ParentId = value;
			comments = null;
		} }
		private string _ParentId;

		[JsonProperty, Column(Name = "post_id", DbType = "varchar(24)")]
		public string PostId { get => _PostId; set {
			if (_PostId == value) return;
			_PostId = value;
			posts = null;
		} }
		private string _PostId;

		[JsonProperty, Column(Name = "created_at", DbType = "datetime")]
		public DateTime CreatedAt { get; set; } = DateTime.Now;

		[JsonProperty, Column(Name = "edited_at", DbType = "datetime")]
		public DateTime? EditedAt { get; set; }

		[JsonProperty, Column(Name = "html", DbType = "longtext")]
		public string Html { get; set; }

		[JsonProperty, Column(Name = "status", DbType = "varchar(50)")]
		public string Status { get; set; }

		[JsonProperty, Column(Name = "updated_at", DbType = "datetime")]
		public DateTime UpdatedAt { get; set; }


		#region 外键 => 导航属性，ManyToOne/OneToOne

		[Navigate("MemberId")]
		public virtual Members members { get; set; }

		[Navigate("ParentId")]
		public virtual Comments comments { get; set; }

		[Navigate("PostId")]
		public virtual Posts posts { get; set; }

		#endregion

		#region 外键 => 导航属性，OneToMany

		[Navigate("CommentId")]
		public virtual List<CommentLikes> comment_likess { get; set; }

		[Navigate("CommentId")]
		public virtual List<CommentReports> comment_reportss { get; set; }

		[Navigate("ParentId")]
		public virtual List<Comments> commentss { get; set; }

		#endregion

		#region 外键 => 导航属性，ManyToMany

		#endregion
	}

}
